package com.example.sneakerappforme1105.adapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.example.sneakerappforme1105.fragment.CartFragment;
import com.example.sneakerappforme1105.fragment.HomeFragment;
import com.example.sneakerappforme1105.fragment.MyFragment;

public class SneakerPagerAdapter extends FragmentPagerAdapter {


    public SneakerPagerAdapter(FragmentManager fm) {
        super(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        if (position == 0) {
            return new HomeFragment();
        }else if (position == 1){
            return new CartFragment();
        } else if (position == 2){
            return new MyFragment();
        }else{
            return null;
        }
    }

    @Override
    public int getCount() {
        return 3;
    }
}
